package com.boot.canal.handler;

import com.boot.canal.domain.TestOne;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;



/**
 * @Author: lkz
 * @Title: TestOneHandler
 * @Description: 对应数据库中test1表
 * canal.properties中这个canal.instance.parser.parallelThreadSize = 16 打开 不然获取不到消息
 * @Date: 2023/9/18 14:40
 */
@CanalTable(value = "test_one")
@Component
@Slf4j
public class TestOneHandler implements EntryHandler<TestOne> {



    @Override
    public void insert(TestOne testOne) {
        log.info("insert message  {}", testOne);
    }

    @Override
    public void update(TestOne before, TestOne after) {
        log.info("update message  before{}", before);
        log.info("update message  after{}", after);

    }

    @Override
    public void delete(TestOne testOne) {

        log.info("delete message  after{}", testOne);
    }
}
